﻿
Public Class ContactsForm


    Private Sub ContactsForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.ContactBindingSource.DataSource = _
                                        My.WebServices.Service.RetrieveContacts("%mr%")
    End Sub

    Private Sub ContactBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContactBindingNavigatorSaveItem.Click
        Me.ContactBindingSource.EndEdit()
        Dim ds = CType(Me.ContactBindingSource.DataSource,  _
                                   ContactService.AdventureWorksDataSet.ContactDataTable)
        Dim changesTable As DataTable = ds.GetChanges()
        Dim changes As New DataSet
        changes.Tables.Add(changesTable)
        My.WebServices.Service.SaveContacts(changes)
    End Sub
End Class
